package com.jar.exercise.clone;

public class Student implements Cloneable {
	private String name;
	private Integer age;
	private Grade grade;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public Student clone() {
		Student stu = null;
		try {
			stu = (Student) super.clone();
			stu.setGrade(grade.clone());
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}

		return stu;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Grade getGrade() {
		return grade;
	}

	public void setGrade(Grade grade) {
		this.grade = grade;
	}

	public Student() {
	}

	public Student(String name, Integer age, Grade grade) {
		this.name = name;
		this.age = age;
		this.grade = grade;
	}

}
